<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<title>hello</title>

<!-- Bootstrap -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap/bootstrap.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<%--     <img alt="图片" src="<%=request.getContextPath() %>/image/img1.png" /> --%>
<script>
if (self != top) {
	var p = parent;
	var t = self;
	try {
		while (p.document.location == window.location.href) {
			t = p;
			if (p != top) {
				p = p.parent;
			} else {
				break;
			}
		}
	} catch (error) {
		//isEmbed;
	}
	if(t != self){
		t.window.location.href = window.location.href;
	}
}
</script>
<style type="text/css">
body {
	padding-top: 50px;
}
#frame{
	width: 100%;
	height: 1500px;
	scroll:no 
}
#center{
	width: 100%
}
</style>
</head>

<body>
	<!----
* navbar-fixed-top : 导航条置顶
* navbar-inverse : 颜色反转
---->
	<nav class="navbar navbar-default navbar-fixed-top navbar-inverse">
	<div class="container">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed"
				data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="#">菜单</a>
		</div>

		<!-- Collect the nav links, forms, and other content for toggling -->
		<div class="collapse navbar-collapse"
			id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav">
				<li class="active"><a href="#" url="/main_content">首页</a></li>
				<li class="dropdown">
					<a href="#" class="dropdown-toggle"
						data-toggle="dropdown" role="button" aria-haspopup="true"
						aria-expanded="false">书籍订阅 <span class="caret"></span></a>
					<ul class="dropdown-menu">
						<li><a href="#" url="/book/book_show_all.action">已收录书籍</a></li>
						<li><a href="#" url="/book/book_shwo_my.action">我的书籍</a></li>
					</ul>
				</li>
				<li class="dropdown">
					<a href="#" class="dropdown-toggle"
						data-toggle="dropdown" role="button" aria-haspopup="true"
						aria-expanded="false" onclick="alert('该功能预计年底前实现^_^')">照片水印 <span class="caret"></span></a>
					<ul class="dropdown-menu">
						<li><a href="#">添加水印</a></li>
						<li><a href="#">历史照片</a></li>
					</ul>
				</li>
				<li class="dropdown"><a href="#" class="dropdown-toggle"
					data-toggle="dropdown" role="button" aria-haspopup="true"
					aria-expanded="false">系统监测 <span class="caret"></span></a>
					<ul class="dropdown-menu">
						<li><a href="#" url="/chart/device/server_info_show.action">硬件监测</a></li>
						<li><a href="#" url="/db/index.html">数据库监测</a></li>
					</ul>
				</li>
			</ul>
<!-- 			<form class="navbar-form navbar-left" role="search"> -->
<!-- 				<div class="form-group"> -->
<!-- 					<input type="text" class="form-control" placeholder="查询"> -->
<!-- 				</div> -->
<!-- 				<button type="submit" class="btn btn-default">查询</button> -->
<!-- 			</form> -->
			<ul class="nav navbar-nav navbar-right">
				<li class="login"><a href="<%=request.getContextPath()%>/login_show">登陆</a></li>
				<li class="login"><a href="#" url="/register">注册</a></li>
				<li class="logout"><a href="<%=request.getContextPath()%>/login/logout.action">退出</a></li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="logout"><a href="#">欢迎您:${sessionScope.uname}</a></li>
			</ul>
		</div>
		<!-- /.navbar-collapse -->
	</div>
	<!-- /.container-fluid --> 
	</nav>
	<div id="center">
		<iframe id="frame" src="<%=request.getContextPath()%>/main_content" >
		
		</iframe>
	</div>
	
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script src="<%=request.getContextPath() %>/js/bootstrap/bootstrap.min.js"></script>
	<script type="text/javascript">
		window.ctxPath ="<%=request.getContextPath() %>"
		jQuery(function(){
			
			$(".dropdown-menu li a").click(function(){
				
				if(!"${sessionScope.uname}"){
					$(".login").show();
					$(".logout").hide();
					alert("请登录!");
				}
				
			})
			$("ul li a").click(function(){
				var url = $(this).attr("url");
				
				if(!"${sessionScope.uname}" && url!="/register" && url!="/main_content"){
					
					return;
				}
				//alert(url)
				if(url){
					$("#frame").attr('src',window.ctxPath+url);
				}
			})
			if("${sessionScope.uname}"){
				$(".login").hide();
				$(".logout").show();
			}else{
				$(".login").show();
				$(".logout").hide();
			}
		})
		
	</script>
</body>

</html>
